<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META   HTTP-EQUIV="Pragma"   CONTENT="no-cache">   
<META   HTTP-EQUIV="Cache-Control"   CONTENT="no-cache">   
<META   HTTP-EQUIV="Expires" CONTENT="0">  
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/assets/login.css" /> 
<script src="${pageContext.request.contextPath}/assets/js/jquery-1.10.2.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/myValidate.js"></script>
		<script src="${pageContext.request.contextPath}/assets/js/common.js"></script>
<title>英飞国际教育集团公司</title>
</head>
<body>
<table class="login" cellpadding="0" cellspacing="0" border="0">
	<tr>
    	<td>
        	<div class="main" id="main">
            	<div class="logo"><img class="vm" src="${pageContext.request.contextPath}/assets/allImage/logo.png" alt="EDI" title="ED-In" /></div>
                <div class="form-box">
                	<div class="item"><label class="label"><img class="vm mr10" src="${pageContext.request.contextPath}/assets/allImage/login_04.png" alt="用户ico" />手<span class="vhide">—</span>机</label><input title="请输入电话号码" class="inp-txt" type="text"  require='true'  meth="notNull,isMobil" maxlength="11" title="请输入电话号码"  value="13511112222" name="tell" id="tell"/></div>
                	<div class="item"><label class="label"><img class="vm mr10" src="${pageContext.request.contextPath}/assets/allImage/login_05.png" alt="用户ico" />密<span class="vhide">—</span>码</label><input title="请输入密码" value="13511112222" class="inp-txt"  require='true'  meth="notNull,isMobil" maxlength="11" title="请输入密码"  type="password"  name="userPwd" id="userPwd"/></div>
                	<div class="item"><label class="label"><img class="vm mr10" src="${pageContext.request.contextPath}/assets/allImage/store.png" alt="用户ico" />类<span class="vhide">—</span>型</label>
                		<select style='width:110px;' id="userType"> 
                		   <option value="6">管理人员</option>
                		   <option value="4">助教</option>
                		   <option value="2">老师</option>
                		   <option value="5">专家</option>
                		   <option value="1">学生</option>
                		</select>
                	</div>
                	<div class="item"><label class="label">&nbsp;</label><span class="btn-box"><input class="inp-btn-1" type="button" id="login" value="登录" /></span><span class="btn-box fl-r"><input class="inp-btn-2" type="button" id="result" value="重置" /></span></div>
                </div>
            </div>
        </td>
    </tr>
</table>
<script type="text/javascript"> 
(function(){
	//校验手机号码
	function isMobil(s) {
	    //var patrn = /^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;
	    var patrn = /^(13[0-9]{9})|(14[0-9])|(18[0-9])|(15[0-9][0-9]{8})$/;
	    if (!patrn.exec(s)) return false
	    return true
	}
	var login = function(){
		if(isMobil($("#tell").val())==false){
			alert("手机输入格式错误！");
			return;
		}
		if($("#userPwd").val().length<=0){
			alert("密码不能为空");
			return;
		}
		var object = OAajaxSubmit("main");  
		var url ="${pageContext.request.contextPath}/system/loginAction.do?method=login";
 
		$.ajax({
			   type: "POST",
			   url: url,
			   data: object,
			   dataType:'json',
			   success: function(msg){
			       if(msg.code == 0){
			    	   alert(msg.message);
			    	   return;
			       }else{
			    	   window.location.href="${pageContext.request.contextPath}/system/loginAction.do?method=loginUrl";
			       }
			   }
		});
		
	};
	$(function(){
		$("#login").click(login);
	});
})();
</script>
</body>
</html>
